<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>arrToString</title>
  <script>
        var a = [1,1,1,2,2,3,4,5,6,3,4,2,4,1,];
    var arr = [];
    for (var i = 0; i < a.length; i++)
    {
        if (arr.indexOf(a[i]) == -1)
          arr.push(a[i]);
    }
  
    console.log(arr);
   
  </script>
</head>
<body>
  
</body>
</html>